class Util{
    public static <T extends Comparable<T>> T findMax(T[] array){
        T max = array[0];
        for (int i = 1; i < array.length; i++) {
            if(array[i].compareTo(max) > 0){
                max = array[i];
            }
        }
        return max;
    }
}
public class demo6 {
    public static void main(String[] args) {
        Integer[] array = {1,2,3,4,5};
        Integer ret = Util.findMax(array);
        System.out.println(ret);
    }
}
